﻿using Core;
using Core.Domain;
using Core.Domain.Common;
using System.Collections.Generic;

namespace Services.ExtendedAttributes
{
    /// <summary>
    /// 扩展属性接口
    /// </summary>
    public partial interface IExtendedAttributeService
    {
        #region ExtendedAttributes
        /// <summary>
        /// 获取扩展属性分页
        /// </summary>
        /// <param name="name"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        IPagedList<ExtendedAttribute> GetAllExtendedAttributes(string name, int pageIndex = 0, int pageSize = 2147483647); //Int32.MaxValue


        /// <summary>
        /// 删除扩展属性
        /// </summary>
        /// <param name="customer"></param>
        void DeleteExtendedAttribute(ExtendedAttribute entity);

        /// <summary>
        /// 根据主键获取扩展属性
        /// </summary>
        /// <returns></returns>
        ExtendedAttribute GetExtendedAttributeById(int extendedAttributeId);
        /// <summary>
        /// 获取集合
        /// </summary>
        /// <param name="ExtendedIds"></param>
        /// <returns></returns>
        IList<ExtendedAttribute> GetExtendedAttributeByIds(int[] ExtendedIds);

        /// <summary>
        /// 根据实体类型获取所有属性
        /// </summary>
        /// <param name="extend"></param>
        /// <returns></returns>
        IList<ExtendedAttribute> GetExtendedAttributeByEnum(ExtendEnum extend);

        /// <summary>
        /// 新增扩展属性
        /// </summary>
        void InsertExtendedAttribute(ExtendedAttribute entity);

        /// <summary>
        /// 更新扩展属性
        /// </summary>
        void UpdateExtendedAttribute(ExtendedAttribute entity);


        #endregion


        #region ExtendedAttributesValue
        /// <summary>
        /// 根据属性值获取集合
        /// </summary>
        /// <param name="ExtendedId"></param>
        /// <returns></returns>
        IList<ExtendedAttributeValue> GetAllExtendValues(int ExtendedId);
        
        /// <summary>
        /// 新增值
        /// </summary>
        /// <param name="entity"></param>
        void InsertValue(ExtendedAttributeValue entity);

        /// <summary>
        /// 更新值
        /// </summary>
        /// <param name="entity"></param>
        void UpdateValue(ExtendedAttributeValue entity);

        /// <summary>
        /// 根据主键获取值信息
        /// </summary>
        /// <param name="valueId"></param>
        /// <returns></returns>
        ExtendedAttributeValue GetValueById(int valueId);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="entity"></param>
        void DeleteValue(ExtendedAttributeValue entity);

        /// <summary>
        /// 删除集合
        /// </summary>
        /// <param name="entitys"></param>
        void DeleteValues(IList<ExtendedAttributeValue> entitys);
        #endregion
    }
}
